<?
layout("/inc/win_layout.html",{title:sysTitle}){
    ?>
<div id="page-wrapper" style="margin-left: 0px;height: 100%;overflow:  auto;">
       
      <!--BEGIN CONTENT-->
      <div class="page-content" style="min-height: auto;">
      
      <div class="row mbl">
           <div class="col-lg-6">
               <div class="input-group input-group-sm mbs">
					<span class="input-group-btn">
						<select id="queryParams" data-toggle="dropdown" class="btn btn-danger dropdown-toggle" style="width :100px;">
		                    <option value="nameZh">中文名称</option>
		                    <option value="nameEn">英文名称</option>
                    	</select>
                   	</span> 
                   		 <input id="text" type="text" placeholder="请输入关键词..." class="form-control" /><span
						class="input-group-btn"><button type="button"
							data-toggle="dropdown" class="btn btn-success dropdown-toggle" onclick="demo1('1')">搜索</button>
					</span>
				</div>
			</div>
		 	
		</div>

		<table
			class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
			<thead>
				<tr>
					
					<th >序号</th>
					<th >英文名称</th>
					<th >中文名称</th>
					
					<th >描述</th>
					<th >操作</th>
				</tr>
			</thead>
			<tbody id="findallDictItem"></tbody>
		</table>
		<div id="dataNull" class="panel-body"
				style="height: 90px; line-height: 50px;" align="center">
				<span class='subtitle' style="font-size: 15px;">数据为空!</span>
		</div>
		<div id="page2" style="text-align: center; margin-top: 20px;"></div>
	</div>
<form action="./DataImportTempletdownload.do" method="post" name="aa" target="_blank">
<input id="downdd" name="downdd" value="" type="hidden"/>
<input id="downloadid" name="downloadid" value="" type="hidden"/>
</form>
	<!--END CONTENT-->
</div>

<?} ?>
<!-- 
<iframe name="child" src="dictItem-add-updateBiao.html" id="ifr" style="HEIGHT: 0px; LEFT: 0px; POSITION: absolute;  WIDTH: 0px"></iframe>
 -->
<script>
	var curr;
	$(function() {
		demo1(1);
	});
	function demo1(curr) {
			$.getJSON("./KnowledgeclassListallcell.do",
				{
					page : curr || 1,
					pageNumber:10,
					queryParams:$("#queryParams").val(),
			        text:$("#text").val()
				},
				function(res) {
							//此处仅仅是为了演示变化的内容
							var str = "";
							$("#findallDictItem").html("");	
											 if(res.listsize>0){
					$("#dataNull").hide();
				}else{
					$("#dataNull").show();
				}				
							for ( var i = 0; i < res.listsize; i++) {
								str += "<tr>"
								+"<td>"+ (i+1) + "</td>"
								+"<td>"+ res.result[i].nameEn + "</td>"
								+"<td>"+ res.result[i].nameZh + "</td>"
								+"<td>"+ res.result[i].description + "</td>"
								+ "<td> <button type=\"button\" class=\"btn btn-default btn-xs\"  onclick=\"download('"
								+ res.result[i].id
								+ "')\">"
								+ "下载"
								+ "</button>"
								+ "   <button type=\"button\" class=\"btn btn-default btn-xs\"  onclick=\"downtype('"
								+ res.result[i].id
								+ "')\">"
								+ "导入说明"
								+ "</button>"		
								+ "</td></tr>"
								
							}	
								$("#findallDictItem").append(str);
								
						laypage({
						cont : document.getElementById("page2"), //容器。值支持id名、原生dom对象，jquery对象,
						pages : res.pageSize, //总页数
						skip : true, //是否开启跳页
						curr : curr || 1,
						last: res.pageSize,
						skin : 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
						groups : 6,//连续显示分页数
						jump : function(obj, first) { //触发分页后的回调
							if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
								demo1(obj.curr);
				                 curr=obj.curr;
							}
						}
					});
								
						});
	};

function download(kk){

$("#downdd").val("0");
$("#downloadid").val(kk);
document.forms['aa'].submit();
}
function downtype(kk){
$("#downdd").val("1");
$("#downloadid").val(kk);
document.forms['aa'].submit();
}
</script>